Format Conversion Scripts
Utilities for converting planetary geospatial data between various formats including ISIS3, 3D mesh formats, and specialized projections.Astropedia_gdal2ISIS3.py
Creates ISIS3-compatible cube files with detached labels from GDAL-supported images.Usage
Parameters
Input GDAL-supported georeferenced image
Output ISIS3 cube filename
Options
Print detailed image information during processing
Generate only the label file (.lbl) without creating the image cube
Attach the label to the ISIS image using ISIS3 cubeatt (requires ISIS3 installation)
Force longitude domain to 0-360 instead of -180 to 180
Override the center longitude value
Set the pixel base value for DN conversion
Set the pixel multiplier/scale value
Output Files
The script creates multiple output files:- output.cub - Raw image data in ENVI format
- output.lbl - ISIS3 detached label with metadata
- output.History.IsisCube - Processing history
Supported Projections
- Simple Cylindrical (GEOGCS)
- Equirectangular
- Sinusoidal
- Transverse Mercator
- Orthographic
- Mercator
- Polar Stereographic (North/South)
Example
Data Types Supported
- Byte - 8-bit unsigned integer
- Int16 - 16-bit signed integer
- UInt16 - 16-bit unsigned integer
- Float32 - 32-bit floating point
- Float64 - Converted to Float32
gdal2PLY.py
Converts digital elevation models (DEMs) to PLY mesh format for 3D visualization.Usage
Parameters
Input DEM in any GDAL-supported format
Output PLY mesh file (binary format)
Features
- Creates binary PLY format for efficient storage
- Generates triangulated mesh from DEM grid
- Preserves X, Y, Z coordinates
- Suitable for import into 3D visualization software
NoData Handling
The script does not currently handle NoData values. Use this workaround:
-
Find the minimum elevation:
-
Set NoData to a value below minimum and resample:
- Run gdal2PLY on the processed file
Example
Output Format
PLY format includes:- Vertex positions (x, y, z)
- Triangle face definitions
- Binary encoding for efficiency
gdal2gores.py
Remaps Simple Cylindrical projected images into gore projections for printing and mounting on spheres.Usage
Parameters
Number of gores to generate (default: 8)
Input Simple Cylindrical map projection image
Output gore image (GeoTIFF format)
Quiet mode - suppress progress output
How It Works
- Divides the input image into N vertical strips (gores)
- Applies cosine warping to each gore based on latitude
- Creates output suitable for cutting and mounting on spherical objects
Example
Use Cases
- Creating physical globe models
- Educational materials
- Art and craft projects with planetary maps
- Tennis ball or baseball sphere mapping
Input image must be in Simple Cylindrical projection. Use
gdalwarp to reproject if necessary.gdal2xyz_geocentricSpace.py
Converts elevation DEMs to geocentric (body-fixed) XYZ ASCII coordinates.Usage
Parameters
Input elevation DEM (elevation values in meters)
Output ASCII file (defaults to stdout)
Options
Sampling factor to skip pixels (default: 1)
Body radius in meters (default: 1737400.0 for Moon)
Band number containing variable radius values
Band number containing latitude values
Band number containing longitude values
Elevation band number (default: 1)
Process only a subset window
Add CSV header line to output
Output Lon,Lat,Elevation instead of X,Y,Z
Output Format
Default output (body-fixed coordinates):-printLatLon:
Coordinate Calculation
For spherical bodies:Example
Default Radii
- Moon: 1,737,400 m
- Mars: 3,396,190 m (use
-radiusoption) - Other bodies: specify with
-radius
AsterMeta2Shapefile.py
Converts a directory of ASTER metadata (.meta) files into a polygon shapefile.Usage
Parameters
Output shapefile name
How It Works
- Searches current directory for all
*.metafiles - Extracts corner coordinates from each metadata file
- Creates polygon features with ASTER scene ID as attribute
- Outputs WGS84 geographic coordinate system shapefile
Metadata File Format
Expects ASTER metadata files with format:Example
Output Attributes
- Name - ASTER scene identifier
- Geometry - Polygon footprint
Use Cases
- Creating ASTER scene coverage maps
- Planning data acquisitions
- Visualizing available data in GIS
- Filtering scenes by location
ogr_footprintinit2shp (footprintinit2shp.py)
Converts ISIS3 caminfo geometry PVL files to ESRI Shapefiles with WKT geometry.Usage
Parameters
Input PVL file from ISIS3 caminfo command
WKT projection file to define coordinate system
ISIS3 Workflow
To create a PVL file ready for this tool:Output Files
Creates multiple files:.shp- Shapefile geometry.shx- Shapefile index.dbf- Attribute database.prj- Projection file (if input projection provided).csv- Intermediate CSV with WKT.vrt- Virtual format file
Use Cases
- Footprint cataloging - Create spatial index of image coverage
- Mission planning - Visualize existing image coverage
- Data discovery - Find images covering specific regions
Column names from PVL will be truncated to fit shapefile field name limits (10 characters).
ogr_isisminer2shp (isisminer2shp.py)
Converts ISIS3 isisminer CSV results to ESRI Shapefiles.Usage
Parameters
Input CSV file from isisminer command
WKT projection file for coordinate system definition
Requirements
Input CSV must contain geometry columns. Common isisminer geometry formats:- WKT (Well-Known Text) geometry column
- Separate latitude/longitude columns
- Footprint polygon coordinates
Use Cases
- Analysis results visualization - Convert isisminer analysis to GIS format
- Quality control - Spatially review data mining results
- Integration - Combine with other GIS datasets
Requirements
Common Dependencies
All conversion scripts require:- Python 2.7+ or Python 3.x (script-dependent)
- GDAL/OGR Python bindings
Additional Dependencies
- gdal2PLY.py: NumPy
- gdal2xyz_geocentricSpace.py: NumPy/Numeric
- ogr_footprintinit2shp: pvl library
- ogr_isisminer2shp: pvl library (if using WKT geometry)